home *** CD-ROM | disk | FTP | other *** search
- Path: in2.uu.net!interaccess!usenet
- From: brianmcg@interaccess.com (Brian V. McGroarty)
- Newsgroups: comp.lang.c
- Subject: Re: BoundsChecker and fgets fmalloc problems
- Date: 19 Mar 1996 01:38:20 GMT
- Organization: Internet Squire
- Message-ID: <4il36c$ltf@nntp.interaccess.com>
- References: <4ikfds$h8c@nnrp1.news.primenet.com>
- Reply-To: brianmcg@interaccess.com
- NNTP-Posting-Host: d48-isdn.nhe.interaccess.com
- X-Newsreader: Internet Squire 1.20
-
- I haven't used Bounds Checker, but my guess would be that you might not be
- closing the file after reading from it. I would suspect that some IO
- libraries don't create memory buffers until data is actually read from a
- file. If a buffer is being created at this point, the memory might not be
- freed by the library if you don't explicitly close the file.
-
-
- Brian Gregory wrote:
- >I am using Bounds Checker v2.5, and am having a problem finding a
- >memory leak it is reporting...
-
- >Example:
-
- >fgets( szBuf, 799, fpIn );
-
- >szBuf is an 800 character buffer (pre-sized array)
- >fpIn IS a valid pointer
- >no memory is corrupt before the fgets line
- >The application is a windows app, written in straight C with a large
- >memory model.
-
- >The problem is Boundschecker consistently reports memory leaks for the
- >larger buffer size mallocs contained WITHIN the fgets function...
-
-
-
-
- ---
- Brian Valters McGroarty -- brianmcg@bix.com
- phone/fax (847) 439-7714
-
-
-
-